package com.acme.task4;

public class Task4Arrays {
	/**
	 * Get random integer for array index
	 * @return int Random integer in range 0-2
	 */
	private static int getRandomIndex(){ // 
		int index = 0;
		index = (int)(Math.random() * (2 + 1));
		return index;
	}
	
	public static void main(String[] args) {
		final int[] NUMBERS = {3,7,9}; // allowed numbers
		int array[] = new int[100];
		int c0 = 0, c1 = 0, c2 = 0, index; //BYDLOCODE DETECTED
		for (int i = 0; i < array.length; i++){
			index = getRandomIndex(); // Get random array index
			array[i] = NUMBERS[index]; // Push random int from array NUMBERS to array
			switch (index){ // check what kind of number we've got
				case 0: {
					c0++;
					break;
				}
				case 1: {
					c1++;
					break;
				}
				case 2: {
					c2++;
					break;
				}
			}
		}
		System.out.println("Number of 3: " + c0);
		System.out.println("Number of 7: " + c1);
		System.out.println("Number of 9: " + c2);
	}
}
